package 考题_K.大小驼峰命名转换_K2;

import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String str = in.nextLine();
		if(isUpper(str)){
			System.out.println(Lower(str));
		}else{
			String[] dataStr = str.split("_");
			dataStr[1] = Upper(dataStr[1]).toString();
			System.out.println(dataStr[0]+dataStr[1]);
		}
		in.close();
	}
	
	public static boolean isUpper(String str){
		boolean flag = false;
		for(int i = 0; i < str.length(); i++){
			char c = str.charAt(i);
			if(Character.isUpperCase(c)){
				flag = true;
			}
		}
		return flag;
	}
	
	public static StringBuffer Lower(String str){
		StringBuffer sb = new StringBuffer();
		for(int i = 0; i < str.length(); i++){
			char c = str.charAt(i);
			if(!Character.isUpperCase(c)){
				sb.append(c);
			}else{
				sb.append("_");
				sb.append(Character.toLowerCase(c));
			}	
		}
		return sb;
	}
	
	public static StringBuffer Upper(String str){
		StringBuffer sb = new StringBuffer();
		sb.append(Character.toUpperCase(str.charAt(0)));
		for(int i = 1; i < str.length(); i++){
			sb.append(str.charAt(i));				
		}
		return sb;
	}
}
